﻿using LVYAN.Model.AutoMation;
using LVYAN.Utils;
using System.Threading.Tasks;

namespace LVYAN.Service.AIAPI
{
    /// <summary>
    /// 
    /// </summary>
    public class MoudleManage : BaseAPI
    {
        /// <summary>
        /// 聊天记录 模型记录
        /// </summary>
        /// <returns></returns>
        public static void ModuleRecord(RobotRobotOther Robot,string RequestMessage, string RequestContent, string ResponseContent, int InToken, int OutToken)
        {
            Task.Run(() =>
            {
                var RequestId = new SignService().SignMD5($"{Robot.Id}{RequestContent}{ResponseContent}{InToken}{OutToken}");
                var content = JsonService.ToString(new
                {
                    RequestId,
                    RobotId = Robot.Id,
                    RequestMessage,
                    RequestContent,
                    ResponseContent,
                    InToken,
                    OutToken,
                });
                new LoggerService().ResponseMsgDebug("模型记录", "模型记录发送消息", content);
                var result = new RequestService().PostJson($"{AIAPI}api/aichat/ModuleRecord", content);
                new LoggerService().ResponseMsgDebug("模型记录", "模型记录接受消息", result);
            });
        }


    }
}
